var express = require('express');
var router = express.Router();
var shareController=require('../controllers/shareController')
var passport = require('passport')

/* GET home page. */
//分享圈
router.get('/shareContent',function (req, res, next) {
    shareController.shareContent(req,res)
});

//已发布内容
router.get('/publish/:userId',passport.authenticate('jwt',{session:false}),function (req, res, next) {
    shareController.publish(req,res)
});

//分享圈详情
router.get('/sharedetail/:upmenuId', function (req, res, next) {
    shareController.sharedetail(req,res)
});

//已发布内容的详情
router.get('/publishdetail/:upmenuId',passport.authenticate('jwt',{session:false}),function (req, res, next) {
    shareController.publishdetail(req,res)
});

//上传菜谱
router.post('/upmenu',passport.authenticate('jwt',{session:false}),function (req, res, next) {
    shareController.upmenu(req,res)
});

//删除已发布菜谱
router.delete('/personal/:upmenuId',passport.authenticate('jwt',{session:false}),function (req, res, next) {
    shareController.personal(req,res)
});

 

//增加分享圈点赞数
router.post('/addlike',passport.authenticate('jwt',{session:false}),  function (req, res, next) {
     shareController.addUserlike(req,res)
});

//取消分析圈点赞数
router.post('/dellike',passport.authenticate('jwt',{session:false}),  function (req, res, next) {
       shareController.celUserlike(req,res)
});

module.exports = router;
